<?php
class CheckOutForm extends CFormModel {
	public $firstname;
	public $lastname;
	public $address;
	public $address_line;
	public $city;
	public $state;
	public $zip;
	public $email;
	public $phone;
	public $message;
	public $payment;
	public $term;
	public $emailPaypal;
	
	public function rules() {
		$rules = array(
			array('firstname, lastname, address, email, phone, message, payment, city, zip', 'required'),
			array('firstname, lastname, address, address_line, email, phone, message, payment, city, zip', 'safe'),
			array('term','required','message'=>'Please accept Terms & Conditions.'),
			array('emailPaypal','required','on'=>'p'),
			array('email','email'),
			array('emailPaypal','email','on'=>'p'),
		);

		return $rules;
	}
	
	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels() {
		return array(
			'firstname'=>ProductsModule::t("First Name"),
			'lastname'=>ProductsModule::t("Last Name"),
			'address'=>ProductsModule::t("Address"),
			'address_line'=>ProductsModule::t("Address Line 2"),
			'city'=>ProductsModule::t("City"),
			'state'=>ProductsModule::t("State"),
			'zip'=>ProductsModule::t("Zip"),
			'email'=>ProductsModule::t("Your Personal Email Address"),
			'phone'=>ProductsModule::t("Reachable Phone"),
			'message'=>ProductsModule::t("Message/Notes"),
			'payment'=>ProductsModule::t("Your Payment Preference"),
			'emailPaypal'=>ProductsModule::t("Payment email"),
		);
	}
	
	public static function getState() {
		$arrState = array(
			"AL" => "AL",
			"AK" => "AK",
			"AZ" => "AZ",
			"AR" => "AR",
			"CA" => "CA",
			"CO" => "CO",
			"CT" => "CT",
			"DE" => "DE",
			"DC" => "DC",
			"FL" => "FL",
			"GA" => "GA",
			"HI" => "HI",
			"ID" => "ID",
			"IL" => "IL",
			"IN" => "IN",
			"IA" => "IA",
			"KS" => "KS",
			"KY" => "KY",
			"LA" => "LA",
			"ME" => "ME",
			"MD" => "MD",
			"MA" => "MA",
			"MI" => "MI",
			"MN" => "MN",
			"MS" => "MS",
			"MO" => "MO",
			"MT" => "MT",
			"NE" => "NE",
			"NV" => "NV",
			"NH" => "NH",
			"NJ" => "NJ",
			"NM" => "NM",
			"NY" => "NY",
			"NC" => "NC",
			"ND" => "ND",
			"OH" => "OH",
			"OK" => "OK",
			"OR" => "OR",
			"PA" => "PA",
			"RI" => "RI",
			"SC" => "SC",
			"SD" => "SD",
			"TN" => "TN",
			"TX" => "TX",
			"UT" => "UT",
			"VT" => "VT",
			"VA" => "VA",
			"WA" => "WA",
			"WV" => "WV",
			"WI" => "WI",
			"WY" => "WY"
		);
		
		return $arrState;
	}
	
	public static function getTermsConditions() {
		$arrTermsConditions = array(
			'term'	=> 'I Accept the Offer<br><a href = "#">Terms & Conditions</a>',
			// 'term2'	=> 'I agree that if my phone powers on but has a defect (broken button, broken screen, bad wifi, missing hardware) it will be paid out at the BROKEN price',
			// 'term3'	=> 'I agree that if my phone does not power on, it will be recycled and no payment will be issued',
			// 'term4'	=> 'Remember me for my next<br>Orange Offer checkout'
		);
		
		return  $arrTermsConditions;
		
	}
}